<div class="subhead ">
  <div class="container mx-auto">
    <h5>~/admin/plans</h5>
    <div class="log-settings">
      <%= render LogflareWeb.AdminSharedView, "nav_links.html", conn: @conn %>
    </div>
  </div>
</div>
<div class="content container mx-auto">
  <h1>Plans</h1>
  <div class="table-responsive">
    <table class="table table-dark">
      <thead>
        <tr>
          <th scope="col">Id</th>
          <th scope="col">Name</th>
          <th scope="col">Stripe Id</th>
          <th scope="col">Price</th>
          <th scope="col">Period</th>
          <th scope="col">Sources</th>
          <th scope="col">Rate Limit </br> <small>(per sec)</small></th>
          <th scope="col">Source Rate Limit </br> <small>(per sec)</small></th>
          <th scope="col">Alerts </br> <small>(ms)</small></th>
          <th scope="col">Saved Searches</th>
          <th scope="col">Team Users</th>
          <th scope="col">Source Fields</th>
          <th scope="col">Source TTL</th>
          <th scope="col"></th>
        </tr>
      </thead>
      <tbody>
        <%= for p <- @plans do %>
        <tr>
          <th scope="row"><%= p.id %></th>
          <td><%= p.name %></td>
          <td><%= p.stripe_id %></td>
          <td><%= p.price %></td>
          <td><%= p.period %></td>
          <td><%= p.limit_sources %></td>
          <td><%= p.limit_rate_limit %></td>
          <td><%= p.limit_source_rate_limit %></td>
          <td><%= p.limit_alert_freq %></td>
          <td><%= p.limit_saved_search_limit %></td>
          <td><%= p.limit_team_users_limit %></td>
          <td><%= p.limit_source_fields_limit %></td>
          <td><%= p.limit_source_ttl %></td>
          <td><%= link "Edit", to: ~p"/admin/plans/#{p}/edit", class: "btn btn-secondary btn-sm" %></td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <%= link "New plan", to: ~p"/admin/plans/new", class: "btn btn-primary" %>
</div>
